package controllers;

import play.mvc.Controller;

public class Authentication extends Controller {

    public static void verify(String username, String password) {
        boolean authenticate = Security.authenticate(username, password);
        if (!authenticate) {
            flash.error("El usuario o password ingresados no son correctos");
        } else {
            flash.success("Bienvenido " + session.get("name"));
        }
        redirect(request.headers.get("referer").value());
    }
}